package org.cy.peoplehill.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Peoplehill implements EntryPoint {
	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		final RootPanel rootPanel = RootPanel.get();
	    final LoginPanel loginPanel = new LoginPanel(new LoginPanel.ExitHandler() {
			@Override
			public void onLoginSuccess(User user) {
				rootPanel.clear();
				MainPanel mainPanel = new MainPanel(user);
				mainPanel.setFocus();
			}
		});
	    
	    rootPanel.add(loginPanel);
	    loginPanel.setFocus(true);
	}
}
